package com.rssnews.controller;

import com.rssnews.pojo.Author;
import com.rssnews.service.AuthorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/login")
public class LoginController {
    /**
     * 登陆页面
     */
    private static final String LOGIN = "login";
    /**
     * 注册页面
     */
    private static final String REGIST = "rehist";
    public class rehist{
        @Autowired
        private AuthorService AuthorService;
        @RequestMapping("REGIST")
        public String regist(Author author, Model model){
            System.out.println("用户注册："+author.getLoginName()+ author.getLoginPwd()+ author.getRealName()+ author.getEmail()+ author.getAuthortypeId());
            author.setAuthorId(1);
            AuthorService.regist(author);
            model.addAttribute("msg","注册成功");
            return "success";
        }
    }

}
